import 'package:flutter/material.dart';

import 'car.dart';

class ListViewDemo extends StatelessWidget {
  Widget _itemForRow(BuildContext context, int index) {
    // return Text(datas[index].name!);
    return Container(
      color: Colors.red,
      margin: const EdgeInsets.all(10),
      child: Column(
        children: [
          Image.network(datas[index].imageUrl!),
          const SizedBox(
            height: 10,
          ),
          Text(datas[index].name!)
        ],
      ),
      // child: Image.network(datas[index].imageUrl!),
    );
  }

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemBuilder: _itemForRow,
      itemCount: datas.length,
    );
  }
}
